//
//  YWMacro.h
//  maintain
//
//  Created by 郑想 on 15/10/9.
//  Copyright (c) 2015年 ewin. All rights reserved.
//
/**
 *  宏定义函数
 */
#import <Foundation/Foundation.h>

//打印日志
#ifdef DEBUG // 处于开发阶段
#define YWLog(...) NSLog(__VA_ARGS__)
#else // 处于发布阶段
#define YWLog(...)
#endif

typedef NS_ENUM(NSUInteger, YWTableViewFreshType) {
    YWTableViewFreshTypeUp = 0, // 上拉
    YWTableViewFreshTypeDown = 1 // 下拉
};

#define XcodeAppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

#define iOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
#define iOS9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
#define iOS8_10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 && [[UIDevice currentDevice].systemVersion doubleValue] < 10.0)
#define iOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

//获取屏幕宽度
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
//获取屏幕高度
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

// RGB颜色
#define YWColor(r, g, b) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:1.0]
// 随机色
#define YWRandomColor YWColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))

//WEAKSELF的宏定义
#define YWWeakSelf(weakSelf) __weak __typeof(&*self) weakSelf = self;

/******************************************************/
/**
 *  UI
 */
//MBProgressHUD 显示字体大小
#define kHUDLabelFont [UIFont systemFontOfSize:14]
#define kMBProgressHUDTag 1501357
//按钮的高度
#define kButtonH 40
//@按钮的宽度
#define kButtonW 40
//按钮字体
#define kBoldTitleFont [UIFont boldSystemFontOfSize:16]

//页面内容字体大小
#define KBigTitleFont [UIFont systemFontOfSize:17]
#define KTitleFont [UIFont systemFontOfSize:16]
#define kContentFont [UIFont systemFontOfSize:15]
#define kBoldContentFont [UIFont boldSystemFontOfSize:15]

#define KSmallContentFont [UIFont systemFontOfSize:14]

//维修记录详情和维保记录详情界面label高度和边缘间隙
#define kLabelH 22
#define kMarginW 10
#define kGapH 10
#define KbottomViewH 44

//工作页面
#define kMaxExpireDay (3)

#define kTopPadding (10)
#define kLeftBgPadding (5)
#define kMinLabelH (20)

#define YWMissionManagerDicLocation @"YWMissionManagerDicLocation"
#define YWMissionManagerDicStatusType @"MissionManagerDicStatusType"
#define YWMissionManagerDicContent @"YWMissionManagerDicContent"
#define YWMissionManagerDicTime @"YWMissionManagerDicTime"
#define YWMissionManagerDicRecordObj @"YWMissionManagerDicRecordObj"
